package com.hl.mapper;

import com.hl.pojo.Expertiseareas;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface FieldMapper {
//    查询所有擅长领域
    @Select("select * from expertiseareas")
    List<Expertiseareas> queryFieldList();
//    根据擅长领域名模糊查询
    @Select("select * from expertiseareas where area_name like concat('%',#{areaName},'%')")
    List<Expertiseareas> likeQueryByName(@Param("areaName")String areaName);
//    新增擅长领域
    @Insert("insert into expertiseareas (area_name) values(#{areaName})")
    int addField(Expertiseareas field);
    @Update("update expertiseareas set area_name=#{areaName} where id=#{id}")
    int updateField(Expertiseareas field);
//    根据id删除领域（批量删除）
    @Delete("delete from expertiseareas where id = #{id}")
    int deleteField(Integer id);
}
